home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
recent
/
iib122.lha
/
IIB
/
Threads
/
sperical_brushmaps
< prev
next >
Wrap
Internet Message Format
|
1998-02-17
|
5KB
Date: Thu, 23 Oct 1997 19:56:55 GMT
From: Robert Dales <robert.dales@UPN.CO.UK>
Subject: [IML] Quest: brushmaps for spherical mapping
On the Imagine FTP site is a brushmap for a golfball which, rather than just
being a series of spots, has been designed so that when it is wrapped around a
sphere the spots appear in the correct place on the sphere rather than being
distorted (am I making sense?). I remember seeing the method for making such
brushmaps in 'Understanding Imagine' but I'm afraid I sold my copy of that
rather excellent book when I sold my Amiga a couple of years ago (the example
given in the book was of a basketball). Does anyone out there know of any
software or methodology that will take a flat brushmap and transform it into one
suitable for mapping round a sphere without distortion?
----------------------------------
Date: Thu, 23 Oct 1997 15:45:50 -0400
From: Javahead jones <smulders@tc.net>
"Roughly" Make your map twice as wide as high. Not perfect by any means;
but seems to do the trick 'somewhat'.
Hajo
----------------------------------
Date: Thu, 23 Oct 1997 13:01:06 -0700
From: Matt Kropp <cmkropp@HOME.NET>
This would be converting 3D polar coordinates to 2D rectangular coordinates.
So if you define your brushmap in X,Y,Z space you can convert it to 2D
rectangular coordinates with
U = arctan(Y/X)
V = arctan(Z/R)
where U and V are the new X and Y locations on your brushmap and R is the
radius of the sphere you are converting to flat mapping. You will have to
decide on appropriate scaling for the image since these formulas only return
values between 0.0 and 1.0 (if you are working in radians).
Incidentally, Adobe PhotoShop has a function to convert images between
rectangular and polar coordinates which almost makes creating spherical image
maps easy. No programming required.
----------------------------------
Date: Thu, 23 Oct 1997 18:33:36 +0400
From: Charles Blaquière <blaq@INTERLOG.COM>
Steve simply made explicit the math behind spherical mapping, i.e. how
the angle around Z and the one around X are transformed into X,Y
coordinates to be looked up in the brushmap. His legendary basketball
brushmaps were generated by a C program he wrote, that calculated
whether a certain point on the basketball should be a stripe, one of the
tiny raised pips, or just plain rubber. The program generated the
appropriate brushmaps that would reproduce the effect when spherically
mapped.
This doesn't help you much in creating brushmaps of your own, unless
you're a programmer. Just remember that a brushmap's horixontal pixels
get mapped to a 360-degree angle around Z, while its vertical dimension
gets wrapped around a 180-degree angle around X. This is why a brushmap
should be twice as wide as tall, since its horizontal dimension gets
wrapped around a full vs. half-circle.
In addition, as you get closer to the poles of the spherically-mapped
object, the brushmap's width is wrapped around an ever-smaller circle,
so details that are the same size (in brushmap pixels) appear
ever-smaller (in Imagine units). Here's an example, with a 200x100
brushmap and a 50-radius sphere:
+-------------------+ C _-+-_
| | / \
| | B +-------+
| | | |
| | A +---------+
| | | |
| | B +-------+
| | \_ _/
+-------------------+ C -+-
<--- 200 pixels ---->
At the sphere's equator (A), the brushmap's horizontal line of 200
pixels gets mapped onto a circle 50 units in diameter, i.e.
(2*pi*radius) 314 units long. Each brushmap pixel is about 1.6 Imagine
units wide.
Halfway up or down the sphere (B), 200 brushmap pixels are wrapped
around a circle only 35.35 Imagine units in diameter, i.e. (2*pi*radius)
212 units long. Each brushmap pixel is about 1.06 Imagine units wide.
Finally, at the poles (C), all 320 pixels at the top or bottom of the
brushmap are squeezed together into a tiny area. Essentially, an entire
horizontal line of black pixels at the top or bottom of the brushmap
would look as big as a single black pixel in the middle!
What all of this teaches you is that, as you move away from the
horizontal centerline of a brushmap, you must paint ever-wider details
if you want them to have a consistent size once mapped into the Imagine
universe. An example is the metal environment brushmap I have placed at
http://www.interlog.com/~blaq/tutorials/BicycleGear/Metal.gif -- notice
how, as you get close to the top and bottom of the image, I faded into
very wide streaks, to ensure blobs as large at the poles as elsewhere.
One foolproof way to generate spherical brushmaps is with Steve's Forge
program, only available for the Amiga. One of its many features is the
ability to wrap a set of texture attributes around an imaginary sphere,
and render a brushmap that, when spherically-wrapped, will reproduce
that appearance.
----------------------------------